<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="./OL_SDK/include-openlayers-local.js"></script>
    <script src="./libs/gaode.js"></script>
    <script src="./utils/delFeatures.js"></script>
</head>

<body>
    <button onclick="deleteArea()">删除区要素</button>
    <div id="map">
    </div>
    <script>
        var docLayer = new Zondy.Map.Doc("", "myTestMap", {

        })
        // console.log(docLayer, 'docLayer')
        var map = new ol.Map({
            target: "map",
            layers: [gaode, docLayer],
            view: new ol.View({
                projection: 'EPSG:4326',
                center: [114.30, 30.50],
                zoom: 4
            })
        })
        function deleteArea() {
            // var fids = [9, 11, 12]
            // var fids = [21, 22]
            var fids = [100, 120]
            // PS.这里如果没有这个OID，也同样会调用完成回调，提示删除成功。
            var service = {
                name: "myTestMap",
                layerId: 2
            }
            delFeatures({
                // 添加时才用的，position和attr，就不要了
                fids,
                service,
                docLayer
            })
        }

    </script>
</body>

</html>